package org.dregs.config;

import com.zaxxer.hikari.HikariDataSource;
import org.dregs.filter.ServerFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

@Configuration
public class ConfigBean {

    //@Bean
    //public DataSource setDataSource(){
    //    return new HikariDataSource();
    //}

    @Bean
    public FilterRegistrationBean setFilter(){
        FilterRegistrationBean filterBean = new FilterRegistrationBean();
        filterBean.setFilter(new ServerFilter());
        filterBean.addUrlPatterns("/*");
        filterBean.setName("Dregs_2");
        return filterBean;
    }

}
